<?php if (!defined('THINK_PATH')) exit();?><!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>睿游内网</title>
<script src="<?php echo (C("web_root")); ?>Public/Js/jquery-1.8.2.min.js"></script>
<style type="text/css">
body{
	margin:0; padding:0; font:14px '微软雅黑'; width:100%; height:100%;
	background-color:#FFF;
}
div,ul{margin:0; padding:0; list-style:none;}

#table-wrap{width:100%; height:auto; margin:0; padding:0; border:1; border-collapse:0;}
#div-header{width:100%; height:100px; background-color:rgba(1,1,1,0.7); padding:0; margin:0 0 20px 0; font: 25px Verdana, Geneva, sans-serif; color:#FFF;}
#div-header p{margin:0; padding:30px 0 0 50px;}

#div-fun-li{margin:0 0 0 30px;}
#div-fun-li li{width:200px; height:30px; background-color:#CCC; color:#666; text-align:center; margin:5px; padding:10px 0 5px 0; border-radius:3px; letter-spacing:1px; cursor:pointer;}
#div-fun-li li:hover{background-color:#666; color:#FFF;}

#div-ctpg ul{margin-left:10px;}
#div-ctpg li{width:130px; height:25px; float:left;background-color:#9CF; margin-left:5px; border-radius:3px 3px 0 0; text-align:center; cursor:pointer; padding:5px 0 0 0; color:#FFF;}
#div-ctpg li:hover{background-color:rgba(1,1,1,0.6);}
#div-loading{padding-top:7px;display:none; color:#933;}

#div-slt{width:300px; height:30px; margin-right:120px; border:#666 1px solid; text-align:right; padding:0; overflow-y:hidden; border-radius:3px; vertical-align:top;}
.text-1{width:200px; height:30px; margin:0; padding:0; border:0; border-radius:2px 0 0 2px;}
.text-1:focus{outline:none;}
.button-1{width:80px; height:32px; border:0; background-color:#555; color:#FFF; font:12px '微软雅黑';}
.button-1:hover{background-color:#666;}

.div-mask{position:absolute; top:0px; left:00px; padding:0; width:100%; height:0; background-color:rgba(1,1,1,0.7); border-radius:5px; color:#333; overflow:hidden;}
.div-mask table{margin:50px 50px 0 50px; background-color:#FFF; padding:40px 20px; color:#333; border-radius:10px;}
.div-mask table th{text-align:left; border-bottom:#333 1px solid; font-size:14px; height:35px; text-align:left;}
.div-mask table td{height:35px; text-align:left;}

.text-2{width:200px; height:25px; border:#069 1px solid; border-radius:3px;}
.text-2:focus{outline:none; border-color:#F93;}
.text-3{width:100%; height:21px; border:#069 1px solid; border-radius:3px;}
.text-3:focus{outline:none; border-color:#F93;}
.button-2{width:80px; height:30px; background-color:#555; color:#FFF; border:#069 0px solid; border-radius:2px; margin-left:30px; cursor:pointer;}
.button-2:hover{ background-color:#666;}

#div-info-table{width:90%; border-radius:5px; overflow:hidden; padding-bottom:30px; margin-top:0px; border:#333 1px solid;}
#div-info-table table{width:100%;}
#div-info-table table th,#div-info-table table td{text-align:left; padding:7px 0 5px 7px;}
#div-info-table table th{border-bottom:#666 1px solid; background-color::rgba(255,255,255,0.8);; color:#333; cursor:pointer;}
#div-info-table table td{border-bottom:#999 1px solid; background-color:rgba(255,255,255,0.8);}

#div ul{cursor:default;}
#div-page li{border-radius:2px; border:0; background-color:#FFF; border:1px #999999 solid; display:inline; padding:2px 10px; cursor:pointer; margin-right:20px; color:#666;}
#div-page li:hover{color:#069;}

.file-box{ position:relative;width:340px} 
.txt{ height:22px; border:1px solid #cdcdcd; width:180px;} 
.btn{ background-color:#FFF; border:1px solid #CDCDCD;height:24px; width:70px;font:13px '微软雅黑';} 
.file{ position:absolute; top:0; right:40px; height:24px; filter:alpha(opacity:0);opacity: 0;width:260px }

#table_worker_info td{height:30px; border-bottom:#999 1px solid;}
#worker_faceimg{width:150px; margin-left:50px; border:#999 1px solid;}
#td_faceimg{border-left:#999 1px solid;}
#td_blank{}
a{color:#369; text-decoration:underline; cursor:pointer;}

</style>
</head>

<body>
<table id="table-wrap" border="0" cellpadding="0" cellspacing="0" bordercolor="#000000">
	<tr>
    	<td colspan="3"><div id="div-header"><p>Iruiyou's web</p></div></td>
    </tr>
    <tr>
    	<td rowspan="3" width="300px" valign="top">
        	<div id="div-fun-li">
            	<ul>
                	<li id="li-itw" onClick="interviewPanel()">面试安排</li>
                    <li id="li-worker" onClick="workerPanel()">员工信息</li>
                    <li id="li-dev" onClick="devicePanel()">设备管理</li>
             	</ul>
            </div>
        </td>
        <td width="600" height="50px" valign="bottom">
        	<div id="div-ctpg">
            	<ul>
                	<li id="li-wait" onClick="waitItwPage()" class="li-itw">待面试</li>
                    <li id="li-have" onClick="haveItwPage()" class="li-itw">已面试</li>
                    <li id="li-new" class="li-itw">增加</li>
                    <li id="li-dev-new" class="li-dev">增加</li>
                    <li id="li-worker-info" class="li-worker" onClick="selfInfo()">个人信息</li>
                    <li id="li-worker-file" class="li-worker" onClick="selfFile()">个人附件</li>
                    <li id="li-worker-admin" class="li-worker" onClick="adminPanel()">后台管理</li>
                    
                </ul>
                <div id="div-loading">Loading<img src="<?php echo (C("web_root")); ?>Public/Image/loading.gif"></div>
            </div>
        </td>
        <td align="right" style=" border:#FFF 1px solid;">
            <div id="div-slt" align="right"><input type="text" id="slt-keyword" class="text-1"><input type="button" onClick="tellSlt()" value="搜 索" id="slt-submit" class="button-1"></div>
        </td>
    </tr>
    <tr>
    	<td colspan="2" id="td-info-table">
        	<div id="div-mask" class="div-mask" align="center">
            	<form action="../AjaxItw/dealItw" method="post" id="form-itw-deal" class="form-itw">
                	<table cellspacing="5" id="table-deal-itw">
                    	<input type="hidden" name="itw-id" id="itw-id">
                    	<tr><th colspan="3"></th></tr>
                        <tr><td width="100" align="center">结果:</td><td width="300"><input type="text" name="itw-result" id="itw-result" class="text-2"></td></tr>
                        <tr><td align="center">备注:</td><td><input type="text" name="itw-other" id="itw-other" class="text-2"></td></tr>
                        <tr><td colspan="2"><input type="button" onClick="dealItw('submit',0,0)" value="确认" class="button-2"><input type="button" value="取消" onClick="dealItw('reset',0,0)" class="button-2"></td></tr>
                    </table>
                </form>
                <form action="../AjaxItw/addItw" method="post" enctype="multipart/form-data" id="form-itw-add" class="form-itw">
                	<table cellspacing="8" id="table-add-itw">
                    	<tr><th colspan="2">面试基本信息</th></tr>
                    	<tr><td>姓名</td><td><input type="text" name="itw-name" id="itw-name" class="text-2"></td></tr>
                        <tr><td>性别</td><td><input type="radio" value="1" name='itw-sex' checked>男&nbsp;&nbsp;&nbsp;&nbsp;
                            				<input type='radio' value="2" name="itw-sex">女
                                            </td>
                        </tr>
                        <tr><td><label for='itw-contact'>联系方式</label></td><td><input type="text" name="itw-contact" id="itw-contact" class="text-2"></td></tr>
                        <tr><td><label for="itw-itwer">面试官</label></td>
                        	<td><!--<input type="text" name="itw-itwer" id="itw-itwer" class="text-2">-->
                            	<select name="itw-itwer" id="itw-itwer" class="text-2">
                                	<option value="王中艺,wangzhongyi@iruiyou.com">王中艺</option>
                                	<option value="王小冬,wangxiaodong@iruiyou.com">王小冬</option>
                                    <option value="于吉,yuji@iruiyou.com">于吉</option>
                                    <option value="崔永鑫,cuiyongxin@iruiyou.com">崔永鑫</option>
                                    <option value="耿锦,gengjin@iruiyou.com">耿锦</option>
                                    <option value="韩东旭,handongxu@iruiyou.com">韩东旭</option>
                                    <option value="张鹏,zhangpeng@iruiyou.com">张鹏</option>
                                    <option value="王旭,wangxu@iruiyou.com">王旭</option>
                                    <option value="徐静博,xujingbo@iruiyou.com">徐静博</option>
                                    <option value="杨新召,yangxinzhao@iruiyou.com">杨新召</option>
                                    <option value="王中艺,wangzhongyi@iruiyou.com">王中艺</option>                              
                                </select>
                            </td></tr>
                        <tr><td><label for='itw-date'>时间</label></td><td><input type="datetime-local" name="itw-date" id="itw-date" class="text-2"></td>
                        <tr><td><label for="itw-resume">简历</label></td>
                        	<td>
                            	<div class="file-box"> 
									<input type='text' name='textfield2' id='textfield2' class='text-2' value="浏览..." /> 
									<input type="file" name="itw-resume" class="file" id="fileField" size="28" onchange="document.getElementById('textfield2').value=this.value" /> 
								</div>
                            </td></tr>
                        <tr><td><label for='itw-job'>面试职位:</label></td><td><input type="text" name="itw-job" id="itw-job" class="text-2"></td></tr>
                        <tr><td colspan="2">
                            	<input type="button" value="确认" id="button-add-itw" class="button-2">
                                <input type="button" value="取消" id="reset-add-itw" class="button-2">
                        </td></tr>
                    </table>
                </form>
                <form action="../AjaxDev/addItem" method="post" id="form-dev-add" class="form-dev">
                	<table cellspacing="10" id="table-add-dev">
                    	<tr><th colspan="2">设备信息表单</th></tr>
                    	<tr><td><label for="dev-type">类型</label></td><td><input type="text" name="dev-type" id="dev-type" class="text-2"></td></tr>
                        <tr><td><label for="dev-number">型号</label></td><td><input type="text" name="dev-number" id="dev-number" class="text-2"></td></tr>
                        <tr><td><label for="dev-product">厂商</label></td><td><input type="text" name="dev-product" id="dev-product" class="text-2"></td>
                        <tr><td><label for="dev-mac">Mac地址</label></td><td><input type="text" name="dev-mac" id="dev-mac" class="text-2"></td></tr>
                        <tr><td><label for="dev-os">系统</label></td><td><input type="text" name="dev-os" id="dev-os" class="text-2"></td></tr>
                        <tr><td><label for="dev-version">版本</label></td><td><input type="text" name="dev-version" id="dev-version" class="text-2"></td></tr>
                        <tr><td><label for="dev-info">配置</label></td><td colspan="3"><input type="text" name="dev-info" id="dev-info" class="text-2"></td></tr>
                        <tr><td><label for="dev-os">备注</label></td><td><input type="text" name="dev-os" id="dev-os" class="text-2"></td></tr>
                        <tr><td colspan="2"><input type="submit" value="提交" name="dev-submit" id="dev-submit" class="button-2">
                            	<input type="button" value="取消" name="dev-reset" id="dev-reset" onClick="" class="button-2"></td></tr>
                    </table>
                </form>
            </div>
            <div id="div-mask-3" class="div-mask" align="center">
            	<table cellspacing="10">
                	<tr><th colspan="2">员工信息编辑</th></tr>
                    <tr align="left"><td width='80'><label for="worker-name">姓名</label></td><td><input type="text" name="worker-name" value="<?php echo (session('iry_worker_name')); ?>" class="text-2"></td></tr>
                    <tr><td><label for="worker-name">性别</label></td><td>
                    	<input type="radio" name="worker-sex" value="1" checked="checked">男&nbsp;&nbsp;&nbsp;
                    	<input type="radio" name="worker-sex" value="2">女</td></tr>
                    <tr><td><label for="worker-birthday">出生日期</label></td><td><input type="date" name="worker-birthday" value="<?php echo (session('iry_worker_birthday')); ?>" class="text-2">&nbsp;&nbsp;(例：1970/01/01)</td></tr>
                    <tr><td><label for="worker-email">邮箱</label></td><td><input type="text" name="worker-email" value="<?php echo (session('iry_worker_email')); ?>"  class="text-2"></td></tr>
                    <tr><td><label for="worker-branch">部门</label></td><td>
                    	<select name="worker-branch" class="text-2">
                        	<option value="1">游戏程序部</option>
                            <option value="2">游戏策划部</option>
                            <option value="3">游戏运营部</option>
                            <option value="4">游戏测试部</option>
                        </select>
                    </td></tr>
                    <tr><td><label for="worker-phonenum">手机号</label></td><td><input type="text" name="worker-phonenum" value="<?php echo (session('iry_worker_phonenum')); ?>" class="text-2"></td></tr>
                    <tr><td><label for="worker-banknum">银行账号</label></td><td><input type="text" name="worker-banknum" value="<?php echo (session('iry_worker_banknum')); ?>" class="text-2"></td></tr>
                    <tr><td><label for="worker-bank">开户银行</label></td><td><input type="text" name="worker-bank" value="<?php echo (session('iry_worker_bank')); ?>" class="text-2"></td></tr>
                    <tr><td><label for="worker-entryday">入职日期</label></td><td><input type="date" name="worker-entryday" value="<?php echo (session('iry_worker_entryday')); ?>" class="text-2"></td></tr>
                    <tr><td><label for="worker-leaveday">离职日期</label></td><td><input type="date" name="worker-leaveday" value="<?php echo (session('iry_worker_leaveday')); ?>" class="text-2"></td></tr>
                    <tr><td><label for="worker-persionid">身份证号</label></td><td><input type="text" name="worker-persionid" value="<?php echo (session('iry_worker_persionid')); ?>" class="text-2"></td></tr>
                    <tr><td colspan="2">
                            	<input type="button" value="确认" id="button-edit-worker" class="button-2">
                                <input type="button" value="确认" id="button-edit-admin" onClick="adminEdit(<?php echo (session('iry_edit_workerid')); ?>)" class="button-2">
                                <input type="button" value="取消" id="reset-edit-worker" class="button-2">
                        </td></tr>
                </table>
            </div>
            <div id="div-mask-4" class="div-mask" align="center">
            	<table cellpadding="10">
                	<form action="../AjaxWorker/upFile" method="post" enctype="multipart/form-data">
                	<tr><th colspan="2">附件上传</th></tr>
                	<tr><td>附件描述：</td><td><input type="text" name="file-type" class="text-2"></td></tr>
                    <tr><td>附件地址：</td><td>
                    	<div class="file-box"> 
							<input type='text' name='textfield2' id='textfield3' class='text-2' value="浏览..." /> 
							<input type="file" name="worker-file" class="file" id="fileField" size="28" onchange="document.getElementById('textfield3').value=this.value" /> 
						</div>
                    </td></tr>
                    <tr><td colspan="2">
                   		<input type="submit" value="上传" id="button-worker-fileup" class="button-2">
                        <input type="button" value="取消" id="reset-worker-fileup" class="button-2" onClick="disSelfFilePanel()">
                        </td></tr>
                    </form>
                </table>
            </div>
            <div id="div-mask-5" align="center" class="div-mask"></div>
            <div id="div-mask-6" class="div-mask" align="center">
            	<form action="../AjaxWorker/upFaceImg" method="post" enctype="multipart/form-data">
                	<table width="500">
                    	<tr><th colspan="2">头像上传</th></tr>
                        <tr><td>头像:</td><td>
                        	<div class="file-box"> 
							<input type='text' name='textfield2' id='textfield4' class='text-2' value="浏览..." /> 
							<input type="file" name="worker-faceimg" class="file" id="fileField" size="28" onchange="document.getElementById('textfield4').value=this.value" /> 
							</div>
                            </td></tr>
                        <tr><td colspan="3"><input type="submit" value="提交" class="button-2"><input type="button" value="取消" onClick="disFaceimgPanel()" class="button-2"></td></tr>
                    </table>
                </form>
            </div>
            <div id="div-mask-editHaveItw" class="div-mask" align="center">
            	<table cellspacing="10">
                <tr><td>姓名:</td><td><input type="text" id="haveItw-name" class='text-2'></td></tr>
                <tr><td>性别:</td><td>
                	<select id="haveItw-sex" class="text-2">
                    	<option value="1">男</option>
                        <option value="2">女</option>
                    </select>
                </td></tr>
                <tr><td>联系方式:</td><td><input type="text" id="haveItw-contact" class='text-2'></td></tr>
                <tr><td>职位:</td><td><input type="text" id="haveItw-job" class='text-2'></td></tr>
                <tr><td>面试官:</td><td><input type="text" id="haveItw-itwer" class='text-2'></td></tr>
                <tr><td>时间:</td><td><input type="datetime-local" value="2015/02/07 12:00" id="haveItw-date" class='text-2'></td></tr>
                <tr><td>结果:</td><td><input type="text" id="haveItw-result" class='text-2'></td></tr>
                <tr><td>备注:</td><td><input type="text" id="haveItw-other" class='text-2'></td></tr>
                <tr><td colspan="3"><input type="button" value="提交" onClick="editHaveItw('submit',0)" class="button-2">
                <input type="button" value="取消" onClick="editHaveItw('reset',0)" class="button-2"></td></tr>
                </table>
            </div>
        	<div id="div-info-table" align="center"> </div>
        </td>
    </tr>
    <tr>
    	<td colspan="2" align="center" height="50px">
        	<div id="div-page" align="center">
            	<ul>
                <li onClick="setPage('up')">上一页</li>
                <!--
                	<li onClick="setPage('up')">上一页</li>
                    <li onClick="setPage(1)">1</li>
                    <li onClick="setPage(2)">2</li>
                    <li onClick="setPage(3)">3</li>
                    <li onClick="setPage(4)">4</li>
                    <li onClick="setPage(5)">5</li>
                    <li onClick="setPage(6)">6</li>
                    <li onClick="setPage(7)">7</li>
                    <li onClick="setPage(8)">8</li>
                    <li onClick="setPage(9)">9</li>
                    <li onClick="setPage(10)">10</li>
                    <li onClick="setPage('down')">下一页</li>
                    <li onClick="pagePanel()">new</li>
                    -->
                </ul>
            </div>
        </td>
</table>
</body>
<script language="javascript">
//初始化
var thepage = 1;
var editWorkerid = 0;
var tmpInfo = 0;
var minPage = 0;
var maxPage = 18;
var workerSpace = "Interview_wait";
<?php echo ($startFun); ?>;
pagePanel();
//loading设计
function loading(){	$("#div-loading").css("display","block");}
function disLoading(){$("#div-loading").css("display","none");}

//表格标题点击排序
$("#div-info-table th").click(function(){
	$("#div-info-table th").css("background-color","rgba(0,0,0,0.5)");
	$(this).css("background-color","rgba(0,0,0,0.7)");
});
/*搜索栏工作空间定位*/
function tellSlt(){
	switch(workerSpace){
		case "Interview_wait":	sltItw();	break;
		case "Interview_have":	sltItw();	break;
		case "Device":		sltDevice();	break;
		case "Worker":		break;
		default:	alert("Error: tellSlt()");	break;
	}
}

//----------------------------------------翻页处理--------------------
function pagePanel(){
	$("#div-page ul").html("");
	$("#div-page ul").append("<li onClick=\"setPage('up')\">上一页</li>");
	if(thepage>minPage+4 && thepage<maxPage-4){
		
		for(var numX=thepage-4;numX<thepage;numX++){ $("#div-page ul").append("<li onClick=\"setPage("+numX+")\">"+numX+"</li>");}
		$("#div-page ul").append("<li id='li-now-page' onClick=\"setPage("+thepage+")\">"+thepage+"</li>");
		for(var numY=thepage+1;numY<=thepage+4;numY++){ $("#div-page ul").append("<li onClick=\"setPage("+numY+")\">"+numY+"</li>");}
		
	}else if(thepage<=minPage+4){
		
		for(var numX=1;numX<thepage;numX++){ $("#div-page ul").append("<li onClick=\"setPage("+numX+")\">"+numX+"</li>");}
		$("#div-page ul").append("<li id='li-now-page' onClick=\"setPage("+thepage+")\">"+thepage+"</li>");
		for(var numY=thepage+1;numY<=9;numY++){ $("#div-page ul").append("<li onClick=\"setPage("+numY+")\">"+numY+"</li>");}
		
	}else if(thepage>maxPage-4){
		
		for(var numX=maxPage-8;numX<thepage;numX++){ $("#div-page ul").append("<li onClick=\"setPage("+numX+")\">"+numX+"</li>");}
		$("#div-page ul").append("<li id='li-now-page' onClick=\"setPage("+thepage+")\">"+thepage+"</li>");
		for(var numY=thepage+1;numY<=maxPage;numY++){ $("#div-page ul").append("<li onClick=\"setPage("+numY+")\">"+numY+"</li>");}
		
	}
	$("#div-page ul").append("<li onClick=\"setPage('down')\">下一页</li>");
	$("#div-page li").css("background-color","#FFF");
	$("#li-now-page").css("background-color","#999");
}
function setPage(ops){
	switch(ops){
		case "up":	thepage--;	break;
		case "down":thepage++;	break;
		default:	thepage = ops;
	}

	if(thepage == 0 ){alert("已到达首页!"); thepage = 1;}
	else{
		switch(workerSpace){
			case "Interview_wait":
				ajaxItw("waitAllItw",thepage);
			break;
			
			case "Interview_have":
				ajaxItw("haveAllItw",thepage);
			break;
		}
	}
	pagePanel();
}
//----------------------------------------设备模块----------------------------------
/*Device Ajax通道*/
function ajaxDev(funType,data){
	loading();
	switch(funType){
		case "getAllDev":
			$.get("../AjaxDev/doAjax?funType=getAllDev",null,function(data){
				$("#div-info-table").html(data);
				disLoading();
			}).fail(function(){alert("Ajax device was failed");disLoading()});
		break;
		
		case "sltDev":
			$.get("../AjaxDev/doAjax?funType=sltDev&keyword="+data,null,function(data){
				$("#div-info-table").html(data); disLoading();
			}).fail(function(){alert("Ajax select device was failed");disLoading();});
		break;
	}
}

/*Device工作区显示*/
function devicePanel(){
	workerSpace = "Device";
	$("#div-fun-li li").css("border","0");
	$("#li-dev").css("border-top","#000 3px solid");
	
	$(".li-worker").css("display","none");
	$(".li-itw").css("display","none");
	$(".li-dev").css("display","block");
	ajaxDev("getAllDev",null);
	$("#div-page").css("display","none");
}

/*Device搜索功能*/
function sltDevice(){
	var keyword = $("#slt-keyword").val();
	ajaxDev("sltDev",keyword);
}

/*增加设备*/
$("#li-dev-new").click(function(){
	$(".form-itw").css("display","none");
	$(".form-dev").css("display","none");
	$(".form-worker").css("display","none")
	$("#form-dev-add").css("display","block");
	$("#div-mask").css("height",$(window).height()+'px');
});
$("#dev-reset").click(function(){$("#div-mask").css('height','0px')});
//----------------------------------------面试模块----------------------------------

/*Interview Ajax通道*/
function ajaxItw(funType,data){
	loading();
	switch(funType){
		case "waitAllItw":
			$.get("../AjaxItw/doAjax?funType=waitAllItw&thepage="+data,null,function(data){
				$("#div-info-table").html(data);disLoading();
			}).fail(function(){alert("Ajax waitAllItw was failed!");disLoading();});
		break;
		
		case "haveAllItw":
			$.get("../AjaxItw/doAjax?funType=haveAllItw&thepage="+data,null,function(data){
				$("#div-info-table").html(data);disLoading();
			}).fail(function(){alert("Ajax waitAllItw was failed!");disLoading();});
		break;
		
		case "sltItw":
			$.get("../AjaxItw/doAjax?funType=sltItw&keyword="+data,null,function(data){
				$("#div-info-table").html(data);disLoading();
			}).fail(function(){alert("Ajax select was failed!");disLoading();});
		break;
		
		case "getOneItw":
			$.get("../AjaxItw/doAjax?funType=getOneItw&id="+data,null,function(data){
				editHaveItw("show",data);disLoading();
			}).fail(function(){alert("Ajax getOneItw was failed!")});
		break;
		
		case "updateHaveItw":
			$.get("../AjaxItw/doAjax?funType=updateHaveItw&data="+data,null,function(data){
				ajaxItw("haveAllItw",1); $("#div-mask-editHaveItw").css("height",0);
			}).fail(function(){alert("Ajax updateHaveItw was fail!")});
		break;
	}
}

/*Interview 工作空间显示*/
function interviewPanel(){
	workerSpace = "Interview_wait";
	setPage(1);
	$("#div-fun-li li").css("border","0");
	$("#li-itw").css("border-top","#000 3px solid");
	$(".li-itw").css("display","block");
	$(".li-worker").css("display","none");
	$(".li-dev").css("display",'none');
	$("#li-have").css("background-color","#9CF");
	$("#li-wait").css("background-color","#666");
	$("#div-page").css("display","block");
}

/*Interview 切页切换*/
function waitItwPage(){
	workerSpace = "Interview_wait";
	setPage(1);
	$("#li-have").css("background-color","#9CF");
	$("#li-wait").css("background-color","#666");	
}
function haveItwPage(){
	workerSpace = "Interview_have";
	setPage(1);
	$("#li-wait").css("background-color","#9CF");
	$("#li-have").css("background-color","#666");
}

/*面试条目处理*/
function dealItw(type,id,name){
	switch(type){
		case "show":
			$(".form-itw").css("display","none");
			$(".form-dev").css("display","none");
			$("#form-itw-deal").css("display","block");
			$("#div-mask").css("height",$(window).height()+'px');
			$("#itw-id").val(id);
			$("#table-deal-itw th").html(id+":"+name);
		break;
		
		case "submit":
			if($("#itw-result").val() != ""){
				$("#form-itw-deal").submit();
			}else{
				alert("请填写结果!");
			}
		break;
		
		case "reset":
			$("#div-mask").css("height",'0px');
		break;
	}
}

/*已面试条目更改*/
function editHaveItw(type,data){
	switch(type){
		case "run":
			tmpInfo = data;
			ajaxItw("getOneItw",data);
		break;
		
		case "show":
			data = data.split("~");
			$("#haveItw-name").val(data[1]);
			$("#haveItw-sex").val(data[2]);
			$("#haveItw-job").val(data[3]);
			$("#haveItw-contact").val(data[4]);
			$("#haveItw-date").val(data[5]);
			$("#haveItw-itwer").val(data[6]);
			$("#haveItw-result").val(data[8]);
			$("#haveItw-other").val(data[9]);
			$("#div-mask-editHaveItw").css("height",$(window).height()+500+'px');
		break
		
		case "submit":
			var data = new Array(
				tmpInfo,
				$("#haveItw-name").val(),
				$("#haveItw-sex").val(),
				$("#haveItw-job").val(),
				$("#haveItw-contact").val(),
				$("#haveItw-date").val(),
				$("#haveItw-itwer").val(),
				$("#haveItw-result").val(),
				$("#haveItw-other").val()
			);
			data = data.join("~");
			ajaxItw("updateHaveItw",data);
		break;
		
		case "reset":
			$("#div-mask-editHaveItw").css("height",0);
		break;
	}
}

/*增加面试条目*/
$("#li-new").click(function(){
	$(".form-itw").css("display","none");
	$(".form-dev").css("display","none");
	$(".form-worker").css("display","none");
	$("#form-itw-add").css("display","block");
	//$("#div-mask").animate({height:$(window).height()},300);
	$("#div-mask").css("height",$(window).height()+'px');
});

$("#button-add-itw").click(function(){
	if($("#itw-name").val() != "" && $("#itw-contact").val() != "" && $("#itw-date").val() != "" && $("#itw-itwer") != "" && $("#itw-job").val() != ""){
		$("#form-itw-add").submit();
	}else{
		alert("信息不全,请检查");
	}
});
$("#reset-add-itw").click(function(){$("#div-mask").css("height",'0px');});

/*搜索条目*/
function sltItw(){
	var keyword = $("#slt-keyword").val();
	ajaxItw("sltItw",keyword);
}
// JavaScript Document
//----------------------------------------员工信息模块-------------------
//员工信息Ajax通道
function ajaxWorker(fun_type,data){
	loading();
	switch(fun_type){
		case "viewInfo":
			$.get("../AjaxWorker/doAjax?fun_type=viewInfo",null,function(data){
				$("#div-info-table").html(data);
				$(".li-worker").css("background-color","#9CF");
				$("#li-worker-info").css("background-color","#666");
				disLoading();
			}).fail(function(){alert("Worker ajax is faild!")});
		break;
		
		case "editInfo":
			$.get("../AjaxWorker/doAjax?fun_type=editInfo&name="+data[0]+"&sex="+data[1]+"&birthday="+data[2]+"&email="+data[3]+"&branch="+data[4]+"&phonenum="+
			data[5]+"&banknum="+data[6]+"&bank="+data[7]+"&entryday="+data[8]+"&leaveday="+data[9]+"&persionid="+data[10],null,function(){
				ajaxWorker("viewInfo",null);
				$("#div-mask-3").css("height",'0');
			}).fail(function(){alert("Worker ajax is failed!");});
		break;
		
		case "viewFile":
			$.get("../AjaxWorker/doAjax?fun_type=viewFile",null,function(data){
				$("#div-info-table").html(data);
				$(".li-worker").css("background-color","#9CF");
				$("#li-worker-file").css("background-color","#666");
				disLoading();
			}).fail(function(){alert("Worker ajax is faild!")});
		break;
		
		case "deleteFile":
			$.get("../AjaxWorker/doAjax?fun_type=deleteFile&filename="+data[0],null,function(data){
				alert(data);
				ajaxWorker("viewFile",null);
				disLoading();
			}).fail(function(){alert("Delete ajax was failed!")});
		break;
		
		case "adminPanel":
			$.get("../AjaxWorker/doAjax?fun_type=adminPage",null,function(data){
				if(data == "error"){alert("权限拒绝");}
				else{
					$("#div-info-table").html(data);
					$(".li-worker").css("background-color","#9CF");
					$("#li-worker-admin").css("background-color","#666");
				}
				disLoading();
			}).fail(function(){alert("adminPage ajax is failed")});
		break;
		
		case "adminEdit":
			$.get("../AjaxWorker/doAjax?fun_type=adminEdit&workerid="+data[0]+"&name="+data[1]+"&birthday="+data[2]+"&email="+data[3]+"&branch="+data[4]+
			"&phonenum="+data[5]+"&banknum="+data[6]+"&bank="+data[7]+"&entryday="+data[8]+"&leaveday="+data[9]+"&persionid="+data[10],null,function(data){
				$("#div-mask-3").css("height","0");
				ajaxWorker("adminPage",null);
				disLoading();
			}).fail(function(){alert("adminEdit ajax was failed!")});
		break;
		
		case "adminFile":
			$.get("../AjaxWorker/doAjax?fun_type=adminFile&workerid="+data[0],null,function(data){
				$("#div-mask-5").html(data).css("height",$(document).height()+'px');
				disLoading();
			}).fail(function(){alert("adminFile ajax was failed!")});
		break;
	}
}
//头像panel操作
function enFaceimgPanel(){$("#div-mask-6").css("height",$(document).height()+'px');}
function disFaceimgPanel(){$("#div-mask-6").css("height",0);}

//worker工作区切换
function workerPanel(){
	workerSpace = "Worker";
	ajaxWorker("viewInfo",null);
	$("#li-worker").css("border-top","#000 3px solid");
	$("#li-itw").css("border","0");
	$("#li-dev").css("border","0");
	$(".li-itw").css("display","none");
	$(".li-dev").css("display","none");
	$(".li-worker").css("display","block");
	$("#div-page").css("display","none");
}
//admin查看附件
function adminFile(workerid){
	var data = new Array(workerid);
	ajaxWorker("adminFile",data);
}
//取消admin查看附件
function disAdminFile(){
	$("#div-mask-5").css("height",0);
}
//打开信息修改
function editWorkerInfo(){
	$("#div-mask-3").css("height",$(window).height()+500+'px');
	$("#button-edit-worker").css("display","inline");$("#button-edit-admin").css("display","none");
	$('[name = "worker-name"]').val("<?php echo (session('iry_worker_name')); ?>");
	$('[name = "worker-birthday"]').val("<?php echo (session('iry_worker_birthday')); ?>");
	$('[name = "worker-email"]').val("<?php echo (session('iry_worker_email')); ?>");
	$('[name = "worker-phonenum"]').val("<?php echo (session('iry_worker_phonenum')); ?>");
	$('[name = "worker-branch"]').val("<?php echo (session('iry_worker_branch')); ?>");
	$('[name = "worker-banknum"]').val("<?php echo (session('iry_worker_banknum')); ?>");
	$('[name = "worker-bank"]').val("<?php echo (session('iry_worker_bank')); ?>");
	$('[name = "worker-entryday"]').val("<?php echo (session('iry_worker_entryday')); ?>");
	$('[name = "worker-leaveday"]').val("<?php echo (session('iry_worker_leaveday')); ?>");
	$('[name = "worker-persionid"]').val("<?php echo (session('iry_worker_persionid')); ?>");
}
//取消信息编辑
$("#reset-edit-worker").click(function(){$("#div-mask-3").css("height","0");});

//提交修改信息
$("#button-edit-worker").click(function(){
	var name = $('[name="worker-name"]').val();
	var sexgroup = document.getElementsByName("worker-sex");
	for(var i = 0; i<sexgroup.length; i++){
		if(sexgroup.item(i).checked) sex=sexgroup.item(i).value;
	}
	var birthday = $('[name = "worker-birthday"]').val();
	var email = $('[name = "worker-email"]').val();
	var branch = $('[name = "worker-branch"]').val();
	var phonenum = $('[name = "worker-phonenum"]').val();
	var banknum = $('[name = "worker-banknum"]').val();
	var bank = $('[name = "worker-bank"]').val();
	var entryday = $('[name = "worker-entryday"]').val();
	var leaveday = $('[name = "worker-leaveday"]').val();
	var persionid = $('[name = "worker-persionid"]').val();
	
	var infoArray = new Array(name,sex,birthday,email,branch,phonenum,banknum,bank,entryday,leaveday,persionid);
	ajaxWorker("editInfo",infoArray);
});
//后台管理详情信息获取
function adminDetail(workerInfo){
	workerInfo = workerInfo.split(":");
	$("#div-mask-3").css("height",$(window).height()+500+'px');
	$("#button-edit-worker").css("display","none");$("#button-edit-admin").css("display","inline");
	$('[name = "worker-name"]').val(workerInfo[1]);
	$('[name = "worker-birthday"]').val(workerInfo[3]);
	$('[name = "worker-email"]').val(workerInfo[5]);
	$('[name = "worker-phonenum"]').val(workerInfo[4]);
	$('[name = "worker-branch"]').val(workerInfo[6]);
	$('[name = "worker-banknum"]').val(workerInfo[10]);
	$('[name = "worker-bank"]').val(workerInfo[11]);
	$('[name = "worker-entryday"]').val(workerInfo[7]);
	$('[name = "worker-leaveday"]').val(workerInfo[8]);
	$('[name = "worker-persionid"]').val(workerInfo[8]);
	
	editWorkerid = workerInfo[0];
}
//后台信息修改
function adminEdit(){
	var workerid = editWorkerid;
	var name = $('[name="worker-name"]').val();
	var birthday = $('[name = "worker-birthday"]').val();
	var email = $('[name = "worker-email"]').val();
	var branch = $('[name = "worker-branch"]').val();
	var phonenum = $('[name = "worker-phonenum"]').val();
	var banknum = $('[name = "worker-banknum"]').val();
	var bank = $('[name = "worker-bank"]').val();
	var entryday = $('[name = "worker-entryday"]').val();
	var leaveday = $('[name = "worker-leaveday"]').val();
	var persionid = $('[name = "worker-persionid"]').val();
	
	var dataArray = new Array(workerid,name,birthday,email,branch,phonenum,banknum,bank,entryday,leaveday,persionid);
	ajaxWorker("adminEdit",dataArray);
}
//后台管理
function adminPanel(){ajaxWorker("adminPanel",null)};
//个人附件获取
function selfFile(){ajaxWorker("viewFile",null)}
//个人信息获取
function selfInfo(){ajaxWorker("viewInfo",null)}
//个人附件上传
function enSelfFilePanel(){$("#div-mask-4").css("height",$(window).height()+'px');}
//取消附件上传
function disSelfFilePanel(){$("#div-mask-4").css("height",0)}
//删除已上传文件
function deleteSelfFile(filename){
	var dataArray = new Array(filename);
	ajaxWorker("deleteFile",dataArray);
}
</script>
</html>